package com.ruoyi.project.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.SysWithdrawalMapper;
import com.ruoyi.project.system.domain.SysWithdrawal;
import com.ruoyi.project.system.service.ISysWithdrawalService;

/**
 * 申请提现Service业务层处理
 * 
 * @author jjp
 * @date 2020-04-17
 */
@Service
public class SysWithdrawalServiceImpl implements ISysWithdrawalService 
{
    @Autowired
    private SysWithdrawalMapper sysWithdrawalMapper;

    /**
     * 查询申请提现
     * 
     * @param withdrawalId 申请提现ID
     * @return 申请提现
     */
    @Override
    public SysWithdrawal selectSysWithdrawalById(Long withdrawalId)
    {
        return sysWithdrawalMapper.selectSysWithdrawalById(withdrawalId);
    }

    /**
     * 查询申请提现列表
     * 
     * @param sysWithdrawal 申请提现
     * @return 申请提现
     */
    @Override
    public List<SysWithdrawal> selectSysWithdrawalList(SysWithdrawal sysWithdrawal)
    {
        return sysWithdrawalMapper.selectSysWithdrawalList(sysWithdrawal);
    }

    /**
     * 新增申请提现
     * 
     * @param sysWithdrawal 申请提现
     * @return 结果
     */
    @Override
    public int insertSysWithdrawal(SysWithdrawal sysWithdrawal)
    {
        sysWithdrawal.setCreateTime(DateUtils.getNowDate());
        return sysWithdrawalMapper.insertSysWithdrawal(sysWithdrawal);
    }

    /**
     * 修改申请提现
     * 
     * @param sysWithdrawal 申请提现
     * @return 结果
     */
    @Override
    public int updateSysWithdrawal(SysWithdrawal sysWithdrawal)
    {
        sysWithdrawal.setUpdateTime(DateUtils.getNowDate());
        return sysWithdrawalMapper.updateSysWithdrawal(sysWithdrawal);
    }

    /**
     * 批量删除申请提现
     * 
     * @param withdrawalIds 需要删除的申请提现ID
     * @return 结果
     */
    @Override
    public int deleteSysWithdrawalByIds(Long[] withdrawalIds)
    {
        return sysWithdrawalMapper.deleteSysWithdrawalByIds(withdrawalIds);
    }

    /**
     * 删除申请提现信息
     * 
     * @param withdrawalId 申请提现ID
     * @return 结果
     */
    @Override
    public int deleteSysWithdrawalById(Long withdrawalId)
    {
        return sysWithdrawalMapper.deleteSysWithdrawalById(withdrawalId);
    }

    @Override
    public List<SysWithdrawal> selectSysWithdrawal(SysWithdrawal sysWithdrawal) {
        return sysWithdrawalMapper.selectSysWithdrawal(sysWithdrawal);
    }
}
